import {RandomInt}  from './NumUtils'
function guid() {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        var r = Math.random() * 16 | 0,
            v = c == 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16);
    });
}

function uuid() {
    var s = [];
    var hexDigits = "0123456789ABCDEFGHIJKMNOPQRSTUVWXYZ";
    for (var i = 0; i < 36; i++) {
        let random=RandomInt(0,35)
        s[i] = hexDigits.substring(random, random+1);
    }
    s[8] = s[13] = s[18] = s[23] = "-";
    var uuid = s.join("");
    return uuid;
}
export default {guid,uuid,RandomInt}